package com.slorgs.infrastructure.dto;

import com.alibaba.fastjson.JSON;
import com.gateway.common.model.Api;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.HashMap;
import java.util.Map;

@EqualsAndHashCode(callSuper = true)
@Data
public class ApiGroupDTO extends Api {
    private String groupName;

    @Override
    public String toString() {
        Map<String, Object> map = new HashMap<>();
        map.put("idApi", getIdApi());
        map.put("name", getName());
        map.put("path", getPath());
        map.put("group", getGroup());
        map.put("type", getType());
        map.put("method", getMethod());
        map.put("process", getProcess());
        map.put("hystrixProperty", getHystrixProperty());
        map.put("minute", getMinute());
        map.put("version", getVersion());
        map.put("env", getEnv());
        map.put("available", getAvailable());
        map.put("visible", getVisible());
        map.put("description", getDescription());
        map.put("groupName", getGroupName());
        return JSON.toJSONString(map);
    }
}